package com.gary.springboot.registe;

import org.springframework.boot.web.servlet.ServletRegistrationBean;

/**
 * Servlet RegistrationBean
 * 与之相对应的 Filter Listener 分别为
 * FilterRegistrationBean
 * ServletListenerRegistrationBean
 * @author pengrui
 * @date 2020/11/21 - 13:31
 */
public class MyServletRegistrationBean extends ServletRegistrationBean<MyServlet> {
    /**
     *  定义构造方法 在创建对象时指定创建的Servlet 以及他所映射的路径
     * @param servlet
     * @param path
     */
    public MyServletRegistrationBean(MyServlet servlet, String path) {
        super(servlet);
        this.addUrlMappings(path);
    }
}
